//
//  AppDelegate.m
//  To Feel
//
//  Created by 曹宇 on 16/7/13.
//  Copyright © 2016年 caoyu. All rights reserved.
//

#import "AppDelegate.h"
#import "RootCVCOfVideo.h"
#import "LayoutOfRootCVCVideo.h"
#import "LocalController.h"
#import "AudioClassTableViewController.h"
@interface AppDelegate ()<UITabBarControllerDelegate>

@end

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
 
    self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];
    
    self.window.backgroundColor = [UIColor whiteColor];
    
    [self.window makeKeyAndVisible];
    
    LayoutOfRootCVCVideo *layout = [[LayoutOfRootCVCVideo alloc]init];
    RootCVCOfVideo *cvcOfVideo = [[RootCVCOfVideo alloc]initWithCollectionViewLayout:layout];
    LocalController *local = [[LocalController alloc]init];
    AudioClassTableViewController *audio = [[AudioClassTableViewController alloc] init];
    UINavigationController *videoVC = [[[UINavigationController alloc]init]initWithRootViewController:cvcOfVideo];
    UINavigationController *localVC = [[[UINavigationController alloc]init]initWithRootViewController:local];
    UINavigationController *audioVC = [[UINavigationController alloc] initWithRootViewController:audio];
    UITabBarController *tb = [[UITabBarController alloc] init];
    
    videoVC.tabBarItem = [[UITabBarItem alloc]initWithTitle:@"视频" image:[UIImage imageNamed:@"shipin"] tag:100];
    audio.tabBarItem = [[UITabBarItem alloc]initWithTitle:@"音乐" image:[UIImage imageNamed:@"音乐"] tag:200];
    local.tabBarItem = [[UITabBarItem alloc]initWithTitle:@"本地" image:[UIImage imageNamed:@"本地"] tag:300];
    tb.delegate = self;
    
    tb.viewControllers = @[videoVC, audioVC, localVC];

    self.window.rootViewController = tb;

    
    return YES;

}




@end
